package com.goambu.driver.framework.controller.internet;

import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.support.v4.content.WakefulBroadcastReceiver;
import android.util.Log;

import com.goambu.driver.GoAmbuDriverConstants;

public class GcmBroadcastReceiver extends WakefulBroadcastReceiver {

	@Override
	public void onReceive(Context context, Intent intent) {
		ComponentName comp = new ComponentName(context.getPackageName(),
				GCMNotificationIntentService.class.getName());
		startWakefulService(context, (intent.setComponent(comp)));
		setResultCode(Activity.RESULT_OK);
		
		String action = intent.getAction();

	    if(GoAmbuDriverConstants.NOTIFICACION_YES_ACTION.equals(action)) {
	        Log.d("shuffTest","Pressed YES");
	    } else if(GoAmbuDriverConstants.NOTIFICACION_POPUP_ACTION.equals(action)) {
	        Log.d("shuffTest","Pressed POPUP");
	    } else if(GoAmbuDriverConstants.NOTIFICACION_NO_ACTION.equals(action)) {
	        Log.d("shuffTest","Pressed NO");
	    }
	    
		String msg = intent.getStringExtra("msg");
		msg = msg;
		//Log.d("contenido push", msg);
	}
}
